#ifndef WIDGET_H
#define WIDGET_H

#include<controlpoint.h>
#include <QWidget>
#include<queue>
#include<vector>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private:
    std::vector<ControlPoint *>cp;
    Ui::Widget *ui;
    std::queue<std::pair<QPoint, QPoint>> lines;
protected:
    virtual void mouseReleaseEvent(QMouseEvent * ev);
    virtual void mouseDoubleClickEvent(QMouseEvent *event);
    virtual void paintEvent(QPaintEvent *event);
    virtual bool eventFilter(QObject *watched, QEvent *event);

    void initSpline();
    void bezier();
};
#endif // WIDGET_H
